feat(aggregate): add Java-compatible field aggregators - #463
Open
liangjie3138 wants to merge 1 commit into
Open
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Linked issue: close #457
Port the six practical field aggregators missing on the C++ side —
collect,merge_map,nested_update,rbm64,hll_sketch,theta_sketch.Also adds
GenericArray/GenericMap, the in-memoryInternalArray/InternalMapimplementations these aggregators need to build ARRAY and MAPresults.
Tests
18 new unit test cases in
paimon-core-test, covering each aggregator'saggregate / retract / null / type-validation paths.
Three pin behaviour that is easy to "fix" incorrectly, and each was checked by
reverting the corresponding production change and confirming it fails:
BinaryAggMergeFunctionTest.OwnedAccumulatorSurvivesNullInput— drives a realAggregateMergeFunctionso the use-after-free is exercised through theproduction path.
FieldNestedUpdateAggTest.CountLimitCountsNullElementsOfAccumulator— countlimit is measured against the raw element count, matching Java.
FieldIgnoreRetractAggTest.ReversedAggBypassesWrappedOverride— the wrapperdoes not preserve the wrapped aggregator's reversed-aggregation override, also
matching Java.
No integration tests added.
API and Format
Additive only, no signatures changed:
include/paimon/defs.h: four newOptionsconstants —NESTED_KEY,NESTED_KEY_NULL_STRATEGY,NESTED_SEQUENCE_FIELD,COUNT_LIMIT.CoreOptions: aNestedKeyNullStrategyenum plus accessors.FieldAggregator: new virtuals default to the existingAgg/AggReversed.New dependency: Apache DataSketches 5.2.0 (Apache-2.0), resolved through
resolve_dependency()like the other bundled dependencies.Documentation
None.
Generative AI tooling
Generated-by: Claude Code 2.1.220 (Claude Opus 5)